Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make neoforge.mods.toml a generated resource, making it compatible with running from IDE #97

Merged
merged 2 commits into from
Jul 24, 2024

Conversation

shartte
Copy link

@shartte shartte commented Jul 9, 2024

Switching to this approach adds full support for placeholders in neoforge.mods.toml

In contrast to other approaches, this exposes the file where the placeholders are already replaced to the IDE as a normal source-file, meaning it is still responsible for copying it, but that also means cleaning & rebuilding from IDE has the normal intended effect, rather than it conflicting with other Gradle tasks writing to its output directory.

Copy link
Member

@Technici4n Technici4n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a big fan of this change. I just converted MI to this pattern so I can finally build it Gradle-free in my IDE. 😄

build.gradle Outdated
into("build/generated/sources/modMetadata")
}
sourceSets.main.resources.srcDir(generateModMetadata)
tasks.named("neoForgeIdeSync").configure {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to have a nice constant for this? For example, neoForge.ideSyncTask? Not sure we want to make the exact task name API?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes this line in particular I was not so keen on.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose that directly writing the task name in the script and exposing a constant for the task name in the API would be more idiomatic than my suggestion.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively, we actually do make an api on the extension...
neoForge.runTaskOnIdeSync

It's a bit niche though

build.gradle Outdated Show resolved Hide resolved
build.gradle Outdated Show resolved Hide resolved
@shartte shartte force-pushed the mdg-resource-gen branch 2 times, most recently from ed2cd12 to 370fb31 Compare July 18, 2024 21:21
@shartte shartte requested a review from Technici4n July 20, 2024 17:44
build.gradle Outdated Show resolved Hide resolved
@shartte shartte force-pushed the mdg-resource-gen branch from 7473eaf to 0ef7d20 Compare July 21, 2024 20:52
@shartte shartte requested a review from Technici4n July 21, 2024 20:53
@Technici4n Technici4n merged commit d661d57 into 1.21-mdg Jul 24, 2024
2 checks passed
@Technici4n Technici4n deleted the mdg-resource-gen branch July 24, 2024 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants